package edu.szu.huhanpeng.doodlingFight.model 
{
	import edu.szu.huhanpeng.doodlingFight.interfaces.IChessBoardData;
	import edu.szu.huhanpeng.doodlingFight.interfaces.IChessData;
	import edu.szu.huhanpeng.doodlingFight.interfaces.ISquareData;
	import org.puremvc.as3.interfaces.INotifier;
	import org.puremvc.as3.interfaces.IProxy;
	import org.puremvc.as3.patterns.proxy.Proxy;
	
	/**
	 * ...
	 * @author Huhanpeng
	 */
	public class ChessBoardProxy extends Proxy implements IProxy, INotifier 
	{
		
		public static var NAME:String = "ChessBoardProxy";
		
		public function ChessBoardProxy(data:IChessBoardData) 
		{
			super(NAME, data);
		}
		
		public function getSquareByIndex(index:int):ISquareData
		{
			return chessBoardData.allVecByRow[index];
		}
		
		public function getChessByIndex(index:int):IChessData
		{
			return (chessBoardData.allVecByRow[index] as ISquareData).chessData;
		}
		
		public function getColumn(index:int):Vector.<ISquareData>
		{
			return chessBoardData.columnArr[index];
		}
		
		public function getRow(index:int):Vector.<ISquareData>
		{
			return chessBoardData.rowArr[index];
		}
		
		public function get allSquare():Vector.<ISquareData>
		{
			return chessBoardData.allVecByRow;
		}
		
		public function get size():int
		{
			return chessBoardData.size;
		}
		
		protected function get chessBoardData():IChessBoardData
		{
			return data as IChessBoardData;
		}
	}

}